<?php

/**
 * This file is part of the Codizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Codizer Core Team <team@codizer.org>
 * @package     Codizer
 */

abstract class f_package_Patch
{
    abstract public function patch();

    /**
	 * Get the document provider
	 *
	 * @return f_document_Provider
	 */
	public function getDocumentProvider()
	{
		return f_document_Provider::getInstance();
	}

    public function compileDocumentAndTables($moduleName, $documentName)
    {
        $xmlFileObject = f_xml_Xpath::getInstance(MODULES_DIR.DS.$moduleName.DS.'documents'.DS.$documentName.'.xml');
        f_builder_DocumentBuilder::getInstance($xmlFileObject)->noConfirm()->build();
        f_builder_DatabaseBuilder::getInstance()->setXmlObject($xmlFileObject)->noConfirm()->createDocumentTable();
    }
}